package com.riko.comic.module.comic.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.riko.comic.module.comic.bean.po.ChapterComments;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface ChapterCommentsMapper extends BaseMapper<ChapterComments> {

    @Select("SELECT nick FROM user WHERE id = '${id}'")
    String queryUserNick(int id);

    @Select("SELECT * FROM chapter_comments WHERE chapter_id = '${id}' order by comment_time desc")
    List<ChapterComments> queryComments(Integer id);

}
